//
//  cinemaCell.m
//  UI_豆瓣app
//
//  Created by 151129-49宋强 on 15/12/24.
//  Copyright © 2015年 www.lanou3g.com蓝鸥. All rights reserved.
//

#import "cinemaCell.h"

@implementation cinemaCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
       // _imgView.backgroundColor = [UIColor redColor];
        _imgView.image = [UIImage imageNamed:@"bg_eventlistcell"];
        _imgView.layer.cornerRadius = 10;
        _imgView.clipsToBounds = YES;
        [self.contentView addSubview:_imgView];
        
        self.label1 = [[UILabel alloc] init];
       // _label1.backgroundColor = [UIColor blackColor];
        _label1.font = [UIFont systemFontOfSize:22];
        [self.imgView addSubview:_label1];
        
        self.label2 = [[UILabel alloc] init];
       // _label2.backgroundColor = [UIColor blackColor];
        [self.imgView addSubview:_label2];

        self.label3 = [[UILabel alloc] init];
       // _label3.backgroundColor = [UIColor blackColor];
        [self.imgView addSubview:_label3];
        
        _label2.numberOfLines = 0;
        
        }
    return self;
}
+ (CGFloat)heightWithText:(NSString *)text
{
    NSDictionary *dic = @{NSFontAttributeName: [UIFont systemFontOfSize:17]};
    CGSize size = CGSizeMake(375-20, 1000);
    
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    
    return rect.size.height;
    
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _imgView.frame = CGRectMake(10, 10, self.contentView.frame.size.width - 20, self.contentView.frame.size.height - 20);
    _label1.frame = CGRectMake(20, 20, 300, 40);
    _label2.frame = CGRectMake(20, 70, 300, 50);
    _label3.frame = CGRectMake(20, 120, 300, 40);
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
